<%= tag.div(data: { refresh: (defined?(@refresh) && @refresh) || "" }) do %>
  <% if @available_tasks.empty? %>
    <div class="content is-large">
      <h3 class="title is-3"> The MaintenanceTasks gem has been successfully installed! </h3>
      <p>
        Any new Tasks will show up here. To start writing your first Task,
        run <code>bin/rails generate maintenance_tasks:task my_task</code>.
      </p>
    </div>
  <% else %>
    <% if active_tasks = @available_tasks[:active] %>
      <h3 class="title is-4 has-text-weight-bold">Active Tasks</h3>
      <%= render partial: 'task', collection: active_tasks %>
    <% end %>
    <% if new_tasks = @available_tasks[:new] %>
      <h3 class="title is-4 has-text-weight-bold">New Tasks</h3>
	  <div class="grid is-col-min-20">
        <%= render partial: 'task', collection: new_tasks %>
	  </div>
    <% end %>
    <% if completed_tasks = @available_tasks[:completed] %>
      <h3 class="title is-4 has-text-weight-bold">Completed Tasks</h3>
      <%= render partial: 'task', collection: completed_tasks %>
    <% end %>
  <% end %>
<% end %>
